package fr.oz.mobile.common.ui 
{
	import flash.display.GradientType;
	import flash.display.SpreadMethod;
	import flash.display.Sprite;
	import flash.geom.Matrix;
	import flash.geom.Rectangle;
	/**
	 * ...
	 * @author Fazermokeur
	 */
	public class GradientMask extends Sprite
	{
		
		public function GradientMask(ratio:int, rect:Rectangle) 
		{
			var fillType:String = GradientType.LINEAR;
			var colors:Array = [0x0000ff, 0x0000ff];
			var alphas:Array = [0, 1];
			var ratios:Array = [0, ratio];
			var matr:Matrix = new Matrix();
			//matr.createGradientBox(_length, 48, 0, posXBegin);
			matr.createGradientBox(rect.width, rect.height, Math.PI*.5, rect.x, rect.y);
			var spreadMethod:String = SpreadMethod.PAD;
			this.graphics.beginGradientFill(fillType, colors, alphas, ratios, matr, spreadMethod);  
			this.graphics.drawRect(rect.x, rect.y, rect.width, rect.height);
			this.graphics.endFill();
			
			this.mouseEnabled = false;
		}
		
	}

}